﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using GMS.Model;
using System.Collections.Generic;//for list
using GMS.BLL;
using GMS.Utils;

namespace GMS.DAL
{
    /// <summary>
    ///抽象类 AbsUserDal 的摘要说明
    /// </summary>
    public abstract class AbsUserDal
    {
        public AbsUserDal()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }
        public abstract GMS.Model.User GetModel(string UserAccount);
     
    }

    /// <summary>
    /// 工厂类
    /// </summary>
    public class UserDalFactory
    {       
        public AbsUserDal GetUserDal(int dbtype)
        {
            if (dbtype == (int)EnumHelper.E_DbType.DB_SQL)
                return new UserDAL();
            else if (dbtype == (int)EnumHelper.E_DbType.DB_ORACLE)
                return new UserOraDAL();
            else if (dbtype == (int)EnumHelper.E_DbType.DB_ACCESS)
                return new UserAccessDAL();
            else
                return null;
        }
    }

}